package day6;

import javax.rmi.CORBA.Tie;

public class Student extends Person{
	private String className;

	// 在构造方法new子类对象的时候，首先要把父类对象new出来
	public Student() {
		// 代表调用父类无参的构造方法:new Person();
	    // super();
		
	}

	public Student(int id, String name, int age, String className) {
		// 代表调用父类有参构造方法：new Person(id,name,age)
		// Constructor call must be the first statement in a constructor
		super(id, name, age);
		this.className = className;
	}

	public void study() {
		System.out.println("id是"+id+"的"+name+"正在"+className);
	}

	public String getClassName() {
		return className;
	}

	public void setClassName(String className) {
		this.className = className;
	}

	@Override
	public String toString() {
		return "Student [className=" + className + ", id=" + id + ", name=" + name + ", age=" + age + "]";
	}

	
	
	
}
